<?php

use yii\grid\GridView;
use common\helpers\Html;
use common\helpers\Url;
use common\helpers\ImageHelper;
use common\models\bonus\Bonus;
use common\enums\BonusEnum;

$qi = $model->qi;

$this->title = $qi->name.'期'.$model->member->username.'所得列表';
$this->params['breadcrumbs'][] = ['label' => '汇总列表', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $qi->name.'期列表', 'url' => ['member', 'qi'=>$qi->id]];
$this->params['breadcrumbs'][] = ['label' => $this->title];

?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
             <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <div class="box-tools">
                    
                </div>
            </div>
            <div class="box-body table-responsive">
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    // 'filterModel' => $searchModel,
                    //重新定义分页样式
                    'tableOptions' => ['class' => 'table table-hover rf-table'],
                    'columns' => [
                        [
                            'class' => 'yii\grid\SerialColumn',
                            'visible' => false, // 不显示#
                        ],
                        [
                            'attribute' => 'id',
                            'headerOptions' => ['class' => 'col-md-1'],
                        ],
                        [
                            
                            'attribute' => 'member_id',
                            'value'=>function($model){
                                return $model->member->username;
                            },
                            'filter' => false, //不显示搜索框

                        ],
                        [
                            
                            'header' => '真实姓名',
                            'value'=>function($model){
                                return $model->member->realname;
                            },
                            'filter' => false, //不显示搜索框

                        ],
                        [
                            'attribute' => 'bonus_type',
                            'filter' => Bonus::$typeArr,
                            'value' => function ($model)
                            {
                                return Bonus::$typeArr[$model->bonus_type];
                            },
                            'headerOptions' => ['class' => 'col-md-2'],
                        ],
                        [
                            'attribute' => 'amount',
                        ],
                        'tax',
                        'fee',
                        'payment',
                        [
                            
                            'attribute' => 'from_member_id',
                            'value'=>function($model){
                                return $model->fromMember->username;
                            },
                            'filter' => false, //不显示搜索框

                        ],
                        [
                            'attribute' => 'created_at',
                            'filter' => false, //不显示搜索框
                            'format' => ['date', 'php:Y-m-d H:i:s'],
                        ],
                        [
                            'attribute' => 'status',
                            'filter' => Bonus::$statusArr,
                            'value' => function ($model)
                            {
                                return Bonus::$statusArr[$model->status];
                            },
                            'headerOptions' => ['class' => 'col-md-2'],
                        ],
                        [
                            'attribute' => 'pay_at',
                            'filter' => false, //不显示搜索框
                            'format' => ['date', 'php:Y-m-d H:i:s'],
                        ],
                 
                    ],
                ]); ?>
            </div>
        </div>
    </div>